<style>
    .form-group .col-sm-2 {
        max-width: 120px;
    }

    .nav-tabs {
        border-bottom: unset;
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="row content" style="padding: 0px;">

        <div class="panel-group" id="accordion">

            <div class="col-md-6 col-sm-12" style="margin-bottom: 5px">
                <div class="panel panel-success">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse"
                               href="#collapseOne">
                                {:__("线索信息")}
                            </a>
                        </h4>
                    </div>
                    <div id="collapseOne" class="panel-collapse collapse in">
                        <div class="panel-body">

                            <div class="form-group">
                                <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('名称')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-name" data-rule="required" type="text" class="form-control"
                                           name="row[name]" value="{$row.name}"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-telephone" class="control-label col-xs-12 col-sm-2">{:__('电话')}:</label>
                                <div class="col-xs-12 col-sm-8">

                                    <div class="input-group">
                                        <input id="c-telephone" class="form-control"  name="row[telephone]" type="tel" value="{$row.telephone}"  >
                                        <div class="input-group-addon no-border no-padding">
                                        <span>
                                            <button type="button"  class="btn btn-success cloudcall" data-type="clues" data-field="telephone" data-typeid="{$row.id}" data-name="{$row.name}"
                                            ><i class="fa fa-phone"></i> {:__('云呼')}</button></span>

                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('手机')}:</label>
                                <div class="col-xs-12 col-sm-8">

                                    <div class="input-group">
                                        <input id="c-mobile" class="form-control"  name="row[mobile]" type="number" value="{$row.mobile}"  >
                                        <div class="input-group-addon no-border no-padding">
                                        <span>
                                            <button type="button"  class="btn btn-success cloudcall" data-type="clues" data-field="mobile" data-typeid="{$row.id}" data-name="{$row.name}"
                                            ><i class="fa fa-phone"></i> {:__('云呼')}</button></span>

                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('等级')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[level]', $levelList,$row.level, ['class'=>'form-control
                                    selectpicker', 'data-rule'=>'required'])}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('行业')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[industry]', $industryList, $row.industry,
                                    ['class'=>'form-control
                                    selectpicker', 'data-rule'=>'required'])}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">{:__('来源')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    {:build_select('row[source]', $sourceList, $row.source, ['class'=>'form-control
                                    selectpicker', 'data-rule'=>'required'])}
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('标签')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-tags" data-rule="" class="form-control" placeholder="输入后空格确认"
                                           name="row[tags]" type="text" value="{$row.tags}">
                                </div>
                                <small class="pull-left text-gray" style=" margin-left: -10px;line-height: 31px;">输入后空格确认</small>
                            </div>
                            <div class="form-group">
                                <label for="c-address" class="control-label col-xs-12 col-sm-2">地址:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
                                        <select class="province form-control" name="province" data-url="ajax/area">
                                            <option value="{$row.province}" selected=""></option>
                                        </select>
                                        <select class="city form-control" name="city" data-url="ajax/area">
                                            <option value="{$row.city}" selected=""></option>
                                        </select>
                                        <select class="area form-control" name="area" data-url="ajax/area">
                                            <option value="{$row.area}" selected=""></option>
                                        </select>
                                    </div>
                                </div>
                                <small class="pull-left" style=" margin-left: -10px;line-height: 31px;"><i class="fa fa-info-circle"></i> <a href="https://doc.fastadmin.net/facrm/773.html" target="_blank">有问题?</a></small>

                            </div>

                            <div class="form-group">
                                <label for="c-detail_address" class="control-label col-xs-12 col-sm-2">详细地址:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-detail_address" type="text" class="form-control"
                                           name="row[detail_address]"
                                           value="{$row.detail_address}"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea id="c-remark" class="form-control"
                                              name="row[remark]">{$row.remark}</textarea>
                                </div>
                            </div>


                        </div>
                    </div>
                </div>
            </div>


            <div class="col-md-6 col-sm-12" style="margin-bottom: 5px">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a data-toggle="collapse"
                               href="#collapseThree">
                                {:__('资料扩展')}
                            </a>
                        </h4>
                    </div>
                    <div id="collapseThree" class="panel-collapse collapse in">
                        <div class="panel-body">
                            <div id="extend"></div>

                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>



    <div class="col-md-12 col-sm-12">
        <div class="panel panel-default">
            <div class="panel-heading" style="    padding-bottom: 0px;">
                <ul class="nav nav-tabs">

                    <li class="active">
                        <a href="#bulletin" role="tab" data-toggle="tab">跟进记录</a>
                    </li>
                    {if($auth->check('facrm/clues/record/files'))}
                    <li><a href="#files12" role="tab" data-toggle="tab">附件</a></li>
                    {/if}

                </ul>


            </div>
            <div class="panel-body">
                <div id="myTabContent" class="tab-content">
                    <div id="toolbar1" class="toolbar ">
                        <a href="javascript:;" class="btn btn-primary btn-refresh"><i class="fa fa-refresh"></i></a>
                        {if($auth->check('facrm/clues/record/add'))}
                        <a href="javascript:;" data-url="facrm/clues/record/add/ids/{:input('ids')}"
                           class="btn btn-success  btn-dialog "
                           title="添加跟进"><i class="fa fa-plus"></i> 添加跟进</a>
                        {/if}
                    </div>


                    <!-- 跟进记录开始-->
                    <div class="tab-pane fade active in" id="bulletin">
                        <table id="tableflow" class="table table-striped table-bordered table-hover"
                               width="100%"></table>
                    </div>
                    <!-- 跟进记录结束-->

                    {if($auth->check('facrm/clues/record/files'))}
                    <!-- 附件-->
                    <div class="tab-pane fade" id="files12">
                        <table id="t-files" class="table table-striped table-bordered table-hover" width="100%"></table>
                    </div>
                    <!-- 附件-->
                    {/if}
                </div>
            </div>
        </div>

    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    var clues_id = {:input('ids')};
    var record_type_list = {:json_encode($record_type_list)};
</script>




